<template>
	<view class="w-100">
		<view class="flex-1 mt-3 mx-3">
			<view class="row-ac">
				<view class="mr-2">标题:</view>
				<view class="flex-1 border-bottom mr-5">
					<input v-model="form.title" type="text" placeholder="如:5-11日工作报告" class="p-2 " value="" />
				</view>
			</view>
			<view class="flex-1 mx-3 mt-5">
				<view class="font-s-4">工作内容：</view>
				<view class="flex-1 mt-4">
					<textarea v-model="form.content" placeholder="工作内容" class="uni-textarea px-2"/>
				</view>
			</view>
			<view class="flex-1 mt-5 mb-3 row">
				<view class="submit-box row" @click="workreportSubmit">提交报告</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { workreportCreateUrl } from '@/api/index.js'
	export default {
		data(){
			return{
				form:{
					title:'',
					content:''
				}
			}
		},
		methods:{
			workreportSubmit(){
				this.$R.post(workreportCreateUrl, this.form).then(res=>{
					if(res.code == 200){
						uni.showToast({
							title: '提交成功',
							icon: 'none'
						});
						setTimeout(() => {
							uni.navigateBack({
								delta: 1
							});
						}, 1000);
					}
				})
			}
		}
	}
</script>

<style>
	.submit-box{
		width: 300rpx;
		height: 88rpx;
		background-color: #000;
		color: #fff;
	}
</style>